<template>
  <div>
    <ul class="nav-wrapper">
      <li v-for="(item, index) in navContent" :key="index">
        <a href="###" class="navItem" :class="'navItem' + index">
          <div class="nav-title" :class="'title' + index">{{ item.title }}</div>
          <div class="nav-desc">{{ item.desc }}</div>
        </a>
      </li>
    </ul>
  </div>
</template>


<script>
export default {
  name: 'middleNav',
  data() {
    return {
      navContent: [
        {
          title: '自由行',
          desc: '旅行就要更自在'
        },
        {
          title: '跟团游',
          desc: '行程透明省心游'
        },
        {
          title: '当地游',
          desc: '最地道的玩法体验'
        },
        {
          title: '机票',
          desc: '特惠一折起'
        },
        {
          title: '订酒店',
          desc: '一键全网比价'
        },
        {
          title: '签证',
          desc: '出签率高服务佳'
        },
        {
          title: '邮轮',
          desc: '移动的上海城堡'
        }
      ]
    }
  }
}
</script>

<style lang="stylus">
.nav-wrapper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 19px;

  .navItem {
    position: relative;
    display: block;
    width: 127px;
    border: 1px solid #e5e5e5;
    padding-top: 8px;
    padding-left: 7px;
    background-image: url('../../../static/images/index/sprite.png');
    background-repeat: no-repeat;
    background-size: 104px auto;
    background-position-x: 59px;
    background-color: transparent;

    &:hover {
      text-decoration: none;
      box-shadow: 0 4px 12px 0 rgba(0 0 0 0.08);

      .nav-title {
        background-image: url('../../../static/images/index/yuanjiao.png');
        background-repeat: no-repeat;
        background-size: 45px;
        background-position: left bottom;
      }

      .title3, .title5, .title6 {
        background-size: 30px;
      }

      .yuanjiao {
        display: block;
      }

      .nav-desc {
        color: #9d9d9d;
      }
    }

    .nav-title {
      height: 22px;
      line-height: 22px;
      font-size: 16px;
      font-weight: 600;
      color: #333;
    }

    .yuanjiao {
      display: none;
      position: absolute;
      top: 25px;
      width: 45px;
    }

    .nav-desc {
      height: 16px;
      padding-top: 1px;
      font-size: 11px;
      font-weight: 400;
      line-height: 16px;
      color: #9d9d9d;
    }
  }

  .navItem0 {
    background-position-y: -654px;
  }

  .navItem1 {
    background-position-y: -27px;
  }

  .navItem2 {
    background-position-y: -132px;
  }

  .navItem3 {
    background-position-y: -444px;
  }

  .navItem4 {
    background-position-y: -549px;
  }

  .navItem5 {
    background-position-y: -338px;
  }

  .navItem6 {
    background-position-y: -236px;
  }
}
</style>